{extend name='public/bass' /}



{block name="content"}
<div class="ibox-content">
  <form class="form-horizontal m-t" id="commentForm" novalidate="novalidate" method="post" action="/admin/art/{$data.id}">
<!--    请求头的伪装  -->
    <input type="hidden" name="_method" value="PUT"/>
    <div class="form-group">
      <label class="col-sm-3 control-label">栏目：</label>
        {$data.cates_id}
      <div class="col-sm-8">
        <select class="form-control m-b" name="cates_id">
          {foreach $cdata as $item}
          <option value="{$item.id}"  {if $data.cates_id == $item.id} selected {/if}
            >{$item.cate_name}</option>

          {/foreach}
        </select>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label">标题：</label>
      <div class="col-sm-8">
        <input   type="text" value="{$data.title}" class="form-control"  name="title" >
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label">描述：</label>
      <div class="col-sm-8">
        <input  type="text" class="form-control" value="{$data.desn}" name="desn" >

      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label">内容：</label>
      <div class="col-sm-8">
        <textarea id="body" name="body"  >{$data.body}</textarea>
      </div>
    </div>
    <div class="form-group">
      <div class="col-sm-4 col-sm-offset-3">
        <button class="btn btn-primary" type="submit">修改</button>
      </div>
    </div>
  </form>
</div>
{/block}

{block name="js"}
<script src="/static/admin/js/plugins/validate/jquery.validate.min.js"></script>
<script src="/static/admin/js/plugins/validate/messages_zh.min.js"></script>
<script src="/static/admin/js/demo/form-validate-demo.min.js"></script>

<!--ueditor-->
<!-- 配置文件 -->
<script type="text/javascript" src="/static/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/static/ueditor/ueditor.all.js"></script>


<script>
  //前端js验证
  $('#commentForm').validate({
    rules:{
      title:"required",
      desn:"required",
    },
    messages:{
      title:{
        required:"标题必须填写"
      },
      desn:{
        required:"描述必须填写"
      },
    },
    submitHandler:function (form) {
      // alert('确认提交吗?')
      form.submit();
    }

  });
  //实例化编辑器


  var ue = UE.getEditor('body', {
    autoHeight: false
  });



</script>


{/block}

